using System.Collections;
using UnityEngine;
public class IndicatorScript : MonoBehaviour
{
    private float range;
    private float occupy;
    [SerializeField] GameObject rangeIndicator;
    [SerializeField] GameObject occupyIndicator;
    void Awake()
    {
        rangeIndicator.SetActive(false);
        occupyIndicator.SetActive(false);
    }

    public void SetData(BaseItemScript baseItem)
    {
        SetItemData(baseItem.itemData);
    }
    public void SetItemData(ItemsCollection.ItemData itemData)
    {
        range = itemData.configuration.attackRange;
        occupy = itemData.gridSize *.5f;
        occupyIndicator.transform.localScale = Vector3.one * occupy;
        rangeIndicator.transform.localScale = Vector3.one * range;
    }
    /// <summary>
    /// range
    /// </summary>
    /// <param name="show"></param>
    public void SetRangeVisable(bool show)
    {
        rangeIndicator.SetActive(show);
    }
    /// <summary>
    /// occupy
    /// </summary>
    /// <param name="show"></param>
    public void SetOccupyVisable(bool show)
    {
        occupyIndicator.SetActive(show);
    }
    // public void ShowRange()
    // {

    // }
    // public void HideRange()
    // {

    // }
}